package com.demo.aop;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author molly
 * @date 2019年1月11日
 */
public class AspectCountDemo {
	
	private Map<Integer,Integer> counts = new HashMap<Integer,Integer>();

	public void demoCountMethod(int number) {
		System.out.println("=========AspectCountDemo demoCountMethod============");
		int currentCount = getCount(number);
		System.out.println("=AspectCountDemo demoCountMethod number["+number+"] count["+currentCount+"]");
		counts.put(number, currentCount+1);
	}
	
	public int getCount(int number) {
		return counts.containsKey(number) ? counts.get(number) : 0;
	}
	
}
